home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Art⁄Graphics / Image 1.49 / Macros / Video < prev   
Encoding:
Text File  |  1993-03-31  |  2.9 KB  |  137 lines  |  [TEXT/ttxt]

  1. procedure ExtractEvenField(NewWindow:boolean);
  2. {
  3. Replaces odd scan lines with average of neighboring even lines. Can be used to improve the quality of images that have even and odd fields that are out of sync as the result of subject movement during capture.
  4. }
  5. var
  6.   i,width,height,row1,row2:integer;
  7. begin
  8.   SaveState;
  9.   if NewWindow then Duplicate('Even Field');
  10.   GetPicSize(width,height);
  11.   row1:=0; row2:=0;
  12.   for i:=1 to height/2 do begin
  13.     GetRow(0,row1,width);
  14.     PutRow(0,row2,width);
  15.     row1:=row1+2;
  16.     row2:=row2+1;
  17.   end;
  18.   MakeRoi(0,0,width,height/2);
  19.   Copy;
  20.   MakeRoi(0,height/4-1,width,height/2);
  21.   Paste;
  22.   RestoreRoi;
  23.   SetScaling('Bilinear; Same Window');
  24.   ScaleAndRotate(1,2,0);
  25.   RestoreState;
  26. end;
  27.  
  28. macro 'Extract Even Field->New Window';
  29. begin
  30.   ExtractEvenField(true);
  31. end;
  32.  
  33. macro 'Extract Even Field->Same Window';
  34. begin
  35.   ExtractEvenField(false);
  36. end;
  37.  
  38.  
  39. macro 'Make Movie to Disk…';
  40. {
  41. Captures a specified number of images at a specified rate and
  42. saves them to disk. Select an area of interest within the Camera
  43. window before starting.
  44. }
  45. var
  46.   nFrames,n,Left,Top,Width,Height:integer;
  47.   Delay:real;
  48. begin
  49.   GetRoi(Left,Top,Width,Height);
  50.   if width=0 then begin
  51.     PutMessage('First select the area of interest in the Camera window.');
  52.     exit;
  53.   end;
  54.   nFrames:=GetNumber('Number of Frames?',10);
  55.   delay:=GetNumber('Delay Between Frames(seconds)?',60);
  56.   for n:=1 to nFrames do begin
  57.     StopCapturing;
  58.     MakeRoi(Left,Top,Width,Height);
  59.     SaveAs('Frame ',n);
  60.     StartCapturing;
  61.     Wait(delay);
  62.     beep;
  63.   end;
  64.   StopCapturing;
  65. end;
  66.  
  67.  
  68. macro 'Camera and Light Source Test…';
  69.   {Use to test cameras and light sources for temporal stability.}
  70. var
  71.   delay,nFrames:integer;
  72.   i:real;
  73. begin
  74.    nFrames:=trunc(GetNumber('Number of Frames:',10));
  75.    delay:=trunc(GetNumber('Delay in seconds:',10));
  76.    for I:=1 to nFrames do begin
  77.      Capture;
  78.      Measure;
  79.      wait(delay);
  80.   end;
  81. end;
  82.  
  83.  
  84. macro 'Average Frames [A]';
  85. begin
  86.   AverageFrames;
  87. end;
  88.  
  89.  
  90. macro 'Average Frames on Trigger';
  91. begin
  92.   WaitForTrigger;
  93.   AverageFrames;
  94. end;
  95.  
  96.  
  97. macro 'Capture Frames…';
  98. var
  99.   left,top,width,height,n,Camera,nFrames:integer;
  100. begin
  101.   GetRoi(left,top,width,height);
  102.   if width=0 then begin
  103.     PutMessage('Please select an area of interest in the Camera window.');
  104.     exit;
  105.   end;
  106.   nFrames:=GetNumber('Number of frames:',4);
  107.   StartCapturing;
  108.   Camera:=nPics;
  109.   n:=0;
  110.   repeat
  111.     if Button then begin
  112.       MakeRoi(left,top,width,height);
  113.       n:=n+1;
  114.       Duplicate('Frame ',n:1);
  115.       SelectPic(Camera);
  116.       StartCapturing;
  117.     end;
  118.   until n=nFrames;
  119.   StopCapturing;
  120.   Dispose;
  121.   SetOption; TileWindows;
  122. end;
  123.  
  124. macro '(-' begin end; {Menu divider}
  125.  
  126. {Note: keyboard shortcuts do not work when the Video}
  127. {Control dialog box is the active window.}
  128.  
  129. macro 'SetChannel 1 [1]'; begin SetChannel(1) end;
  130. macro 'SetChannel 2 [2]'; begin SetChannel(2) end;
  131. macro 'SetChannel 3 [3]'; begin SetChannel(3) end;
  132. macro 'SetChannel 4 [4]'; begin SetChannel(4) end;
  133.  
  134.  
  135.  
  136.  
  137.